<view>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
</view>
<script>
	import permision from "@/js_sdk/wa-permission/permission.js";
	import Vue from "vue";
	import {
		mapGetters
	} from "vuex";
	// 安卓appid 2019092567821471
	//#ifdef H5
	import wxshare from "./utils/index.js";
	//#endif
	export default {
		globalData: {
			confirm: false,
		},
		onLaunch: function() {
			const user = uni.getStorageSync("Pduser");
			var locationArg = {};
			//消息推送
			//#ifdef APP-PLUS
			const res = uni.getSystemInfoSync();
			if (res.platform != "android") {
				locationArg = {
					// isHighAccuracy: true, // 开启高精度定位
					// highAccuracyExpireTime: '7000', // 设置过期时间，单位为毫秒
				};
			}
			console.log("APP端消息推送代码块");
			plus.push.getClientInfoAsync((info) => {
				let cid = info["clientid"];
				console.log("客户端推送标识1:", info);
				uni.setStorageSync("convencid", cid);
			});
			/* 5+  push 消息推送 ps:使用:H5+的方式监听，实现推送*/
			plus.push.addEventListener(
				"click",
				function(msg) {
					var paymsg = msg.payload;
					if (msg.payload != "") {
						if (paymsg.url) {
							uni.navigateTo({
								url: url,
							});
						}
					} else {
						uni.switchTab({
							url: "/pages/index/index",
						});
					}
					//这里可以写跳转业务代码
				},
				false
			);
			// 监听在线消息事件
			plus.push.addEventListener(
				"receive",
				function(msg) {
					// 增加非空判断  否则ios闪退
					if (msg.content != null && msg.content != "") {
						//震动   用于判断是否成功监听，如果监听成功再往下播放自定义音频，创建通知栏
						//如果没有监听到，往下看，下面有排查错误的流程
						plus.device.vibrate(500);
						console.log("(接受到消息体是):" + JSON.stringify(msg));
						var content = msg.content;
						var conent1 = content.substr(1);
						let content2 = JSON.parse(conent1);
						// console.log(content2.payload, 123213);
						// 播放自定义音频
						if (content2.payload == 1) {
							const innerAudioContext = uni.createInnerAudioContext();
							innerAudioContext.autoplay = true;
							innerAudioContext.src = "https://pic.bangbangtongcheng.com/static/msg.wav";
							innerAudioContext.onPlay(() => {
								console.log("开始播放");
							});
							innerAudioContext.onError((res) => {
								console.log(res.errMsg);
								console.log(res.errCode);
							});
						}
						//通知栏参数
						let options = {
							cover: false,
							sound: "system",
							title: msg.title,
						};
						console.log(content2.content, 2222);
						//创建通知栏消息
						plus.push.createMessage(
							content2.content,
							msg.payload,
							JSON.parse(JSON.stringify(options))
						);
					}
				},
				false
			);
			//#endif
			// console.log(this.checkStutas(user))
			// console.log(user)

			//查询是否被标记离职
			// 判断是房源经纪人或者车主经纪人
			if (user.businessType == 1) {
				this.$myRequest
					.get("/mob/user/isMarkResignation", {
						userId: user.id,
					})
					.then((res) => {
						if (res.code == 200) {
							getApp().globalData.confirm = res.confirm;
						}
					});
			} else {
				this.$myRequest
					.get("/api/mobile/vehicleOwner/getWhetherMarkResignationByUserId", {
						userId: user.id,
					})
					.then((res) => {
						if (res.code == 200) {
							getApp().globalData.confirm = res.confirm;
						}
					});
			}
			uni.hideTabBar();
			let statusBarHeight1;
			const systemInfo = uni.getSystemInfoSync();
			Vue.prototype.$systemInfo = systemInfo;
			// #ifdef APP-PLUS || H5
			statusBarHeight1 = systemInfo.statusBarHeight + 5;
			Vue.prototype.CustomBar = statusBarHeight1;
			this.$store.dispatch("user/setBar", statusBarHeight1);
			//  #endif
			// #ifdef MP-WEIXIN
			statusBarHeight1 = systemInfo.statusBarHeight;
			// statusBarHeight1 = systemInfo.statusBarHeight + 5 + 44;
			Vue.prototype.CustomBar = statusBarHeight1;
			this.$store.dispatch("user/setBar", statusBarHeight1);
			//  #endif
			uni.statusBarHeight1 = statusBarHeight1;
			Vue.prototype.ColorList = [{
					title: "嫣红",
					name: "red",
					color: "#e54d42",
				},
				{
					title: "桔橙",
					name: "orange",
					color: "#f37b1d",
				},
				{
					title: "明黄",
					name: "yellow",
					color: "#fbbd08",
				},
				{
					title: "橄榄",
					name: "olive",
					color: "#8dc63f",
				},
				{
					title: "森绿",
					name: "green",
					color: "#39b54a",
				},
				{
					title: "天青",
					name: "cyan",
					color: "#1cbbb4",
				},
				{
					title: "海蓝",
					name: "blue",
					color: "#0081ff",
				},
				{
					title: "姹紫",
					name: "purple",
					color: "#6739b6",
				},
				{
					title: "木槿",
					name: "mauve",
					color: "#9c26b0",
				},
				{
					title: "桃粉",
					name: "pink",
					color: "#e03997",
				},
				{
					title: "棕褐",
					name: "brown",
					color: "#a5673f",
				},
				{
					title: "玄灰",
					name: "grey",
					color: "#8799a3",
				},
				{
					title: "草灰",
					name: "gray",
					color: "#aaaaaa",
				},
				{
					title: "墨黑",
					name: "black",
					color: "#333333",
				},
				{
					title: "雅白",
					name: "white",
					color: "#ffffff",
				},
			];
			Vue.prototype.authorizationApp = async function(
				StorageName,
				PermissionName,
				tips,
				cellback
			) {
				if (!uni.getStorageSync(StorageName)) {
					var result = await permision.requestAndroidPermission(PermissionName);
					if (result == 1) {
						uni.setStorageSync(StorageName, 1);
						cellback();
					} else if (result == 0) {
						uni.setStorageSync(StorageName, 0);
					} else {
						uni.setStorageSync(StorageName, 0);
					}
					if (uni.getStorageSync(StorageName) == 0) {
						uni.showModal({
							title: "提示",
							content: tips,
							success: function(res) {
								if (res.confirm) {} else if (res.cancel) {}
							},
						});
						return;
					}
				} else {
					cellback();
				}
			};
			uni.locationArg = locationArg;
			Vue.prototype.$SHOWMODAL_TO_SETTINGS = function (option) {
				// #ifdef APP
				if (plus.os.name !== 'iOS') return false;
				console.log("此处废弃！引导打开权限统一使用插件x-perm-apply-instr中index.js")
				let newOption = option || {
					title: '提示',
					content: '操作权限已被拒绝，请手动前往设置',
					confirmText: '立即设置',
				}
				uni.showModal({
					...newOption,
					success: (res) => {
						if (res.confirm) {
							// #ifdef MP-WEIXIN
							uni.openSetting({
							success (res) {
								console.log(res.authSetting);
							},
							complete(res){console.log(res)}
							})
							// #endif
							// #ifdef APP
							// 如果手自身系统、定位权限未开启，引导打开到系统设置页面
							if (plus.os.name === 'iOS') {
								plus.runtime.openURL('app-settings://')
							} else {
								var Intent = plus.android.importClass('android.content.Intent')
								var Settings = plus.android.importClass('android.provider.Settings')
								var Uri = plus.android.importClass('android.net.Uri')
								var mainActivity = plus.android.runtimeMainActivity()
								var intent = new Intent()
								intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
								var uri = Uri.fromParts('package', mainActivity.getPackageName(), null)
								intent.setData(uri)
								mainActivity.startActivity(intent)
							}
							// #endif
						}
					},
				})
				// #endif
			}
			Vue.prototype.$TOLOGIN = function(query = '') {
				uni.navigateTo({
					//#ifdef APP-PLUS || H5
					url: `/pages/login/login${query ? `?${query}` : ''}`,
					//#endif
					//#ifdef MP-WEIXIN
					url: `/pages/login/phoneLogin${query ? `?${query}` : ''}`,
					//#endif
				});
			}
			Vue.prototype.showLogin = function() {
				let userInfo = uni.getStorageSync("Pduser");
				if (!userInfo.phone) {
					uni.showModal({
						title: "",
						content: "尚未登录，前往登录？",
						showCancel: true,
						success: (res) => {
							if (res.confirm) {
								Vue.prototype.$TOLOGIN();
							}
						},
					});
					return false;
				} else {
					return true;
				}
			};
		},
		onHide: function() {
			// console.log('App Hide')
		},
		computed: {
			...mapGetters(["userinfo"]),
		},
		onLoad() {
			// uni.setStorageSync("user_id", "eedb85379df94d2c9ce5aca7d605a93f");
		},
		onShow() {
			// uni.setStorageSync("user_id", "eedb85379df94d2c9ce5aca7d605a93f");
		},
		methods: {
			getScr() {
				var script = document.createElement("script");
				script.src =
					"https://webchat.7moor.com/javascripts/7moorInit.js?accessId=349c0840-2c8b-11ec-8d77-3ba9870f689f&autoShow=false&language=ZHCN";
				document.body.appendChild(script);
			},
			// checkStutas(userInfo) {
			// 	if(userInfo.isEnable!='1'){
			// 		return true
			// 	}
			// 	return false

			// },
		},
	};
</script>

<style lang="scss">
	@import "@/uni_modules/uview-ui/index.scss";
	@import "colorui/main.css";
	@import "colorui/icon.css";
	@import "@/utils/animate.css";

	::-webkit-scrollbar {
		display: none;
		width: 0 !important;
		height: 0 !important;
		-webkit-appearance: none;
		background: transparent;
	}
	.u-switch {
		border-width: 2rpx;
	}
	.u-read-more__toggle.show-shadow {
		z-index: 1;
		background-image: linear-gradient(-180deg, rgba(255, 255, 255, 0) 45%, rgb(255, 255, 255) 80%);
		padding-top: 100px;
    	margin-top: -100px
	}
	* {
		margin: 0;
		padding: 0;
	}

	.animal-scale {
		animation: 0.75s scale2 0s infinite;
		transform: translate(0, -2rpx);
		border-radius: 50%;
		box-shadow: 0px 6rpx 0px #bf2310, 0px 4px 8px rgba(0, 0, 0, 0.2);
	}

	@keyframes scale2 {
		0% {
			transform: translate(0, -2rpx);
			box-shadow: 0px 6rpx 0px #bf2310, 0px 4px 8px rgba(0, 0, 0, 0.2);
		}

		2% {
			transform: translate(0, 2rpx);
			box-shadow: 0px 2rpx 0px #bf2310, 0px 1px 8px rgba(0, 0, 0, 0.1);
		}

		50% {
			transform: translate(0, 2rpx);
			box-shadow: 0px 2rpx 0px #bf2310, 0px 1px 8px rgba(0, 0, 0, 0.1);
		}

		52% {
			transform: translate(0, -2rpx);
			box-shadow: 0px 6rpx 0px #bf2310, 0px 4px 8px rgba(0, 0, 0, 0.2);
		}

		100% {
			transform: translate(0, -2rpx);
			box-shadow: 0px 6rpx 0px #bf2310, 0px 4px 8px rgba(0, 0, 0, 0.2);
		}
	}

	.animal-opacity {
		animation: 1.25s opacity2 0s infinite;
		opacity: 0;
	}

	@keyframes opacity2 {
		0% {
			opacity: 0;
		}

		10% {
			opacity: 1;
		}

		50% {
			opacity: 1;
		}

		100% {
			opacity: 0;
		}
	}

	@keyframes float {
		0% {
			transform: translate(0, 0);
		}

		10% {
			transform: translate(0, -4rpx);
		}

		20% {
			transform: translate(0, 0);
		}

		30% {
			transform: translate(0, -4rpx);
		}

		40% {
			transform: translate(0, 0);
		}

		50% {
			transform: translate(0, -4rpx);
		}

		60% {
			transform: translate(0, 0);
		}

		100% {
			transform: translate(0, 0);
		}
	}

	.animal-float {
		// animation: 1.050s float 0s ease-in-out infinite;
		// padding: 10px 26px;
		position: absolute;
		top: 74rpx;

		left: 234rpx;
		font-size: 36rpx;
		font-weight: 800;
		color: #ffffff;
	}

	.animal-static {
		// padding: 10px 26px;
		position: absolute;
		top: 129rpx;
		left: 324rpx;
		font-size: 20rpx;
		font-weight: 400;
		color: #ffffff;

		&::after {
			content: "";
			width: 38rpx;
			height: 2rpx;
			background-color: white;
			position: absolute;
			top: 50%;
			right: -42rpx;
			transform: translateY(-50%);
		}

		&::before {
			content: "";
			width: 38rpx;
			height: 2rpx;
			left: -42rpx;
			background-color: white;
			position: absolute;
			top: 50%;
			transform: translateY(-50%);
		}
	}

	li {
		list-style: none;
	}

	.GS {
		.corporation {
			max-width: 540rpx;
			/*强制文本在一行内显示*/
			white-space: nowrap;
			overflow: hidden;
			text-overflow: ellipsis;
		}
	}

	.over-text {
		/*强制文本在一行内显示*/
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.nav-list {
		display: flex;
		flex-wrap: wrap;
		padding: 0px 40upx 0px;
		justify-content: space-between;
	}

	.nav-li {
		padding: 30upx;
		border-radius: 12upx;
		width: 45%;
		margin: 0 2.5% 40upx;
		background-image: url(https://cdn.nlark.com/yuque/0/2019/png/280374/1552996358352-assets/web-upload/cc3b1807-c684-4b83-8f80-80e5b8a6b975.png);
		background-size: cover;
		background-position: center;
		position: relative;
		z-index: 1;
	}

	.nav-li::after {
		content: "";
		position: absolute;
		z-index: -1;
		background-color: inherit;
		width: 100%;
		height: 100%;
		left: 0;
		bottom: -10%;
		border-radius: 10upx;
		opacity: 0.2;
		transform: scale(0.9, 0.9);
	}

	.nav-li.cur {
		color: #fff;
		background: rgb(94, 185, 94);
		box-shadow: 4upx 4upx 6upx rgba(94, 185, 94, 0.4);
	}

	.nav-title {
		font-size: 32upx;
		font-weight: 300;
	}

	.nav-title::first-letter {
		font-size: 40upx;
		margin-right: 4upx;
	}

	.nav-name {
		font-size: 28upx;
		text-transform: Capitalize;
		margin-top: 20upx;
		position: relative;
	}

	.nav-name::before {
		content: "";
		position: absolute;
		display: block;
		width: 40upx;
		height: 6upx;
		background: #fff;
		bottom: 0;
		right: 0;
		opacity: 0.5;
	}

	.nav-name::after {
		content: "";
		position: absolute;
		display: block;
		width: 100upx;
		height: 1px;
		background: #fff;
		bottom: 0;
		right: 40upx;
		opacity: 0.3;
	}

	.nav-name::first-letter {
		font-weight: bold;
		font-size: 36upx;
		margin-right: 1px;
	}

	.nav-li text {
		position: absolute;
		right: 30upx;
		top: 30upx;
		font-size: 52upx;
		width: 60upx;
		height: 60upx;
		text-align: center;
		line-height: 60upx;
	}

	.text-light {
		font-weight: 300;
	}

	@keyframes show {
		0% {
			transform: translateY(-50px);
		}

		60% {
			transform: translateY(40upx);
		}

		100% {
			transform: translateY(0px);
		}
	}

	@-webkit-keyframes show {
		0% {
			transform: translateY(-50px);
		}

		60% {
			transform: translateY(40upx);
		}

		100% {
			transform: translateY(0px);
		}
	}

	.flex_nav {
		display: flex;
		justify-content: space-around;
	}

	.flex_end {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.flex {
		display: flex;
	}

	.flex_center {
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.flex_right {
		display: flex;
		justify-content: flex-end;
	}

	.flex_left {
		display: flex;
		justify-content: flex-end;
	}

	scroll-view ::-webkit-scrollbar {
		display: none !important;

		width: 0 !important;

		height: 0 !important;

		-webkit-appearance: none;

		background: transparent;
	}

	::-webkit-scrollbar {
		display: none;
	}

	/* uni-app {
  height: calc(100% - 60rpx);
} */
	uni-checkbox-group {
		width: 100% !important;
	}

	uni-checkbox-group uni-label {
		width: 33% !important;
		display: inline-flex;
		margin-bottom: 20rpx;
	}

	/*checkbox 选项框大小  */
	uni-checkbox .uni-checkbox-input {
		border-radius: 50%;
		border-color: transparent;
		/* background: gray; */
		border: 2rpx solid #aaa;
		width: 28rpx;
		height: 28rpx;
	}

	uni-checkbox::before {
		right: 0;
	}

	/*checkbox选中后样式  */
	uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked {
		// background: #64b6a8;
		// border-color: #64b6a8;
		border-radius: 50%;
	}

	// .uni-checkbox-input {
	//   width: 28rpx;
	//   height: 28rpx;
	// }
	.back1 {
		width: 60rpx;
		height: 200rpx;
		align-items: center;
		justify-content: center;
		text-align: center;
		padding-top: 10rpx !important;
		position: fixed;
		bottom: 220rpx;
		right: 0rpx;
		background: #19caa6;
		box-shadow: 0 0 16rpx 0 rgba(0, 0, 0, 0.2);
		font-size: 24rpx;
		color: #fff;
		border-radius: 10rpx 0rpx 0rpx 10rpx;

		image {
			width: 50rpx;
			height: 50rpx;
		}
	}
	
	// 权限定位
	.binds_frame_bindLocationTip {
		width: 600rpx;
		background-color: #ffffff;
		// padding-bottom: 50rpx;
		border-radius: 20rpx;
		text-align: center;
		font-size: 36rpx;
		overflow: hidden;
	
		.binds_frame_t {
			font-weight: 550;
			color: #000000;
			padding: 0 46rpx;
			padding-top: 36rpx;
		}
	
		.binds_frame_c {
			width: 500rpx;
			margin: 0 auto;
			font-weight: 500;
			color: #000000;
			margin-top: 30rpx;
			margin-bottom: 50rpx;
		}
	
		.binds_frame_b {
			display: flex;
			align-items: center;
			justify-content: space-between;
	
			.confirmAddAccount {
				border: none;
				width: 550rpx;
				height: 90rpx;
				background: #0FA291;
				border-radius: 45rpx;
				text-align: center;
				margin: 0rpx auto;
				color: white;
				line-height: 90rpx;
				margin-top: 80rpx;
			}
	
			.cancel {
				flex: 1;
				height: 90rpx;
				border: 1px solid #eee;
				border-radius: 10rpx 0 0 10rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				font-weight: 400;
				color: #999999;
			}
	
			.determine {
				flex: 1;
				height: 90rpx;
				border: 1px solid #eee;
				border-radius: 0 10rpx 10rpx 0;
				display: flex;
				align-items: center;
				justify-content: center;
				font-weight: 400;
				color: #0FA291;
			}
		}
	}
	
	.topNoBg {
		width: 100%;
		//background: #64b6a8;
		position: relative;
		box-sizing: content-box;
		height: 88rpx;
		/* line-height: 88rpx; */
		line-height: -4rpx;

		// position: fixed;
		// width: 100%;
		// top: 0;
		// left: 0;
		.toptitle {
			text-align: center;
			font-size: 36rpx;
			color: #fff;
			margin-bottom: 30rpx;
		}

		>image {
			// /* #ifdef MP */
			// top: calc(var(--status-bar-height) + 44px + 5px) !important ;
			// /* #endif */
			// /* #ifdef APP-PLUS || H5 */
			// top: calc(var(--status-bar-height) + 5px) !important ;
			// /* #endif */
			// top: 0 ;
			bottom: 28rpx !important;
		}

		.back {
			position: absolute;
			width: 18rpx;
			height: 31rpx;
			bottom: 28rpx;
			left: 39rpx;
		}
	}

	.top {
		width: 100%;
		background: #64b6a8;
		position: relative;
		box-sizing: content-box;
		height: 88rpx;
		/* line-height: 88rpx; */
		line-height: -4rpx;

		// position: fixed;
		// width: 100%;
		// top: 0;
		// left: 0;
		.toptitle {
			text-align: center;
			font-size: 36rpx;
			color: #fff;
			margin-bottom: 30rpx;
		}

		>image {
			// /* #ifdef MP */
			// top: calc(var(--status-bar-height) + 44px + 5px) !important ;
			// /* #endif */
			// /* #ifdef APP-PLUS || H5 */
			// top: calc(var(--status-bar-height) + 5px) !important ;
			// /* #endif */
			// top: 0 ;
			bottom: 28rpx !important;
		}

		.back {
			position: absolute;
			width: 18rpx;
			height: 31rpx;
			bottom: 28rpx;
			left: 39rpx;
		}
	}

	/deep/.uni-checkbox-input-checked {
		background: #007aff;
	}

	/* #ifdef H5 */
	.square uni-checkbox .uni-checkbox-input {
		border-radius: 0% !important;
	}

	uni-checkbox .uni-checkbox-input {
		border-radius: 50% !important;
		color: #ffffff !important;
	}

	uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked {
		border: 2rpx solid transparent !important;
		background: #007aff;
		border-color: #007aff;
	}

	uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked::before {
		line-height: 20rpx;
		text-align: center;
		font-size: 18rpx;
		color: #fff;
		background: transparent;
		transform: translate(-70%, -50%) scale(1);
		-webkit-transform: translate(-70%, -50%) scale(1);
	}

	/* #endif */
	/* 微信样式 */
	/* #ifdef APP-PLUS ||MP-WEIXIN */

	.square checkbox .wx-checkbox-input {
		border-radius: 0% !important;
	}

	checkbox .wx-checkbox-input {
		border-radius: 50% !important;
		color: #ffffff !important;
	}

	checkbox .wx-checkbox-input .wx-checkbox-input-checked {
		color: #fff;
		background: #007aff;
	}

	.wx-checkbox-input .wx-checkbox-input-checked {
		border: none !important;
	}

	/* #endif */
	.hide-scrollbar {
		scrollbar-width: none;
		-ms-overflow-style: none;
		&::-webkit-scrollbar {
			display: none;
		}
	}
</style>